--------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/11b_PaperTables_log.txt
  log type:  text
 opened on:  25 Jun 2026, 13:02:10
r; t=0.00 13:02:10

. 
. include "_OutcomeLabels.do"

. /*==============================================================================
>   _OutcomeLabels.do  (helper, not run on its own)
> 
>   Defines polished, publication-ready labels for every outcome that appears
>   in figures and tables. Labels use the macro pattern `lbl_<outcome>`.
>   Visualization do files `include` this file and reference `lbl_<outcome>`
>   to print a pretty label rather than the raw Stata variable name.
> 
>   Categorical/binary indicators are suffixed with "[=1]" so the reader sees
>   what a unit change means; counts and continuous variables get explicit
>   units; standardized indices are flagged "(SD)".
> 
>   Sandra Rozo
> ==============================================================================*/
. 
. * ---- Economic well-being -----------------------------------------------------
. local lbl_jeea_index_wellbeing  "Well-being index (SD)"
r; t=0.00 13:02:10

. local lbl_labour_income         "Log monthly labor income"
r; t=0.00 13:02:10

. local lbl_gasto_capita          "Log per-capita HH consumption"
r; t=0.00 13:02:10

. local lbl_income_maxhh          "Log HH-max labor income"
r; t=0.00 13:02:10

. local lbl_employed              "Employed [=1]"
r; t=0.00 13:02:10

. 
. * ---- Labor ------------------------------------------------------------------
. local lbl_jeea_index_labor      "Labor index (SD)"
r; t=0.00 13:02:10

. local lbl_formal                "Formal employment [=1]"
r; t=0.00 13:02:10

. local lbl_hora_semana           "Log weekly hours (salaried)"
r; t=0.00 13:02:10

. 
. * ---- Services and rights ----------------------------------------------------
. local lbl_jeea_index_services   "Services index (SD)"
r; t=0.00 13:02:10

. local lbl_sisben                "SISBEN registration [=1]"
r; t=0.00 13:02:10

. local lbl_subs                  "Subsidized health [=1]"
r; t=0.00 13:02:10

. local lbl_bank                  "Savings account [=1]"
r; t=0.00 13:02:10

. local lbl_has_bank_account      "Bank account (incl. savings) [=1]"
r; t=0.00 13:02:10

. local lbl_govtr                 "Govt. transfers [=1]"
r; t=0.00 13:02:10

. 
. * ---- Health -----------------------------------------------------------------
. local lbl_health_pca            "Health PCA index (SD)"
r; t=0.00 13:02:10

. local lbl_anx_depr              "Severe anxiety/depression [=1]"
r; t=0.00 13:02:10

. local lbl_any_anx_depr          "Any anxiety/depression [=1]"
r; t=0.00 13:02:10

. local lbl_vas_score             "Self-rated health (0-100)"
r; t=0.00 13:02:10

. local lbl_phys_problem          "Physical health problem [=1]"
r; t=0.00 13:02:10

. local lbl_chronic_illness       "Chronic illness [=1]"
r; t=0.00 13:02:10

. local lbl_mh_index              "Mental-health composite (SD)"
r; t=0.00 13:02:10

. local lbl_life_satisfaction     "Life satisfaction (0-10)"
r; t=0.00 13:02:10

. local lbl_hi5_inv               "EQ-5D anx/depr (5-low to 1-high)"
r; t=0.00 13:02:10

. 
. * ---- Food security ----------------------------------------------------------
. local lbl_index_food            "Food security index (SD)"
r; t=0.00 13:02:10

. local lbl_skip_meals            "Skipped meals last month [=1]"
r; t=0.00 13:02:10

. local lbl_went_without_food     "Went without food [=1]"
r; t=0.00 13:02:10

. local lbl_protein_days          "Days w/ protein (last week)"
r; t=0.00 13:02:10

. local lbl_food_insecure_seek    "Sought food assistance [=1]"
r; t=0.00 13:02:10

. 
. * ---- Housing ----------------------------------------------------------------
. local lbl_index_housing         "Housing quality index (SD)"
r; t=0.00 13:02:10

. local lbl_adequate_housing      "Adequate housing [=1]"
r; t=0.00 13:02:10

. local lbl_has_electricity       "Has electricity [=1]"
r; t=0.00 13:02:10

. local lbl_has_water             "Has running water [=1]"
r; t=0.00 13:02:10

. local lbl_has_sewage            "Has sewage [=1]"
r; t=0.00 13:02:10

. 
. * ---- Integration ------------------------------------------------------------
. local lbl_index_integration     "Integration index (SD)"
r; t=0.00 13:02:10

. local lbl_belonging             "Sense of belonging (1-4)"
r; t=0.00 13:02:10

. local lbl_feel_integrated       "Feels integrated (1-4)"
r; t=0.00 13:02:10

. local lbl_trust_col             "Trust in Colombians (out-group, 1-5)"
r; t=0.00 13:02:10

. local lbl_trust_ven             "Trust in Venezuelans (in-group, 1-5)"
r; t=0.00 13:02:10

. local lbl_general_trust         "General trust in people (1-5)"
r; t=0.00 13:02:10

. local lbl_venezuelans_help_me   "Venezuelans help me (1-5)"
r; t=0.00 13:02:10

. local lbl_trust_index           "Prosocial behaviors composite (SD)"
r; t=0.00 13:02:10

. local lbl_col_friends           "Number Colombian friends"
r; t=0.00 13:02:10

. local lbl_community_org         "Belongs to community org [=1]"
r; t=0.00 13:02:10

. local lbl_connection_colombia   "Strong connection to Colombia [=1]"
r; t=0.00 13:02:10

. local lbl_colombians_help_me    "Colombians help me (1-5)"
r; t=0.00 13:02:10

. local lbl_count_on_col          "Can count on Colombians (1-5)"
r; t=0.00 13:02:10

. 
. * ---- Discrimination ---------------------------------------------------------
. local lbl_index_discrim         "Discrimination index (SD)"
r; t=0.00 13:02:10

. local lbl_discrim_ever          "Ever discriminated against [=1]"
r; t=0.00 13:02:10

. local lbl_discrim_freq          "Discrimination frequency (1-5)"
r; t=0.00 13:02:10

. local lbl_filed_complaint       "Filed discrimination complaint [=1]"
r; t=0.00 13:02:10

. 
. * ---- Migration intentions ---------------------------------------------------
. local lbl_intend_stay           "Intends to stay in Colombia [=1]"
r; t=0.00 13:02:10

. local lbl_plan_stay_5yr         "Plans to stay 5+ years [=1]"
r; t=0.00 13:02:10

. local lbl_considered_return_ven "Considered returning to Venezuela [=1]"
r; t=0.00 13:02:10

. 
. * ---- COVID -----------------------------------------------------------------
. local lbl_index_covid           "COVID resilience index (SD)"
r; t=0.00 13:02:10

. local lbl_covid_income_down     "Income fell during COVID [=1]"
r; t=0.00 13:02:10

. local lbl_covid_eviction        "Faced eviction during COVID [=1]"
r; t=0.00 13:02:10

. local lbl_covid_received_aid    "Received COVID aid [=1]"
r; t=0.00 13:02:10

. 
. * ---- Education -------------------------------------------------------------
. local lbl_currently_studying    "Currently studying [=1]"
r; t=0.00 13:02:10

. local lbl_currently_enrolled    "Currently enrolled in school [=1]"
r; t=0.00 13:02:10

. local lbl_degree_validated      "Foreign degree validated [=1]"
r; t=0.00 13:02:10

. 
. * ---- Children --------------------------------------------------------------
. local lbl_child_skip_meals      "Child skipped meals [=1]"
r; t=0.00 13:02:10

. local lbl_child_vaccinated      "Child vaccinated [=1]"
r; t=0.00 13:02:10

. local lbl_child_worked          "Child worked [=1]"
r; t=0.00 13:02:10

. 
. * ---- Remittances -----------------------------------------------------------
. local lbl_index_remit           "Remittances index (SD)"
r; t=0.00 13:02:10

. local lbl_remit_now             "Sends remittances now [=1]"
r; t=0.00 13:02:10

. local lbl_remit_to_parents      "Remits to parents [=1]"
r; t=0.00 13:02:10

. 
. * ---- Financial access and digital ------------------------------------------
. local lbl_index_fin_access      "Financial access index (SD)"
r; t=0.00 13:02:10

. local lbl_index_digital         "Digital access index (SD)"
r; t=0.00 13:02:10

. local lbl_has_savings_account   "Has savings account [=1]"
r; t=0.00 13:02:10

. local lbl_has_mobile_money      "Has mobile money [=1]"
r; t=0.00 13:02:10

. local lbl_has_smartphone        "Has smartphone [=1]"
r; t=0.00 13:02:10

. local lbl_has_internet          "Has internet [=1]"
r; t=0.00 13:02:10

. local lbl_apps_whatsapp         "Uses WhatsApp [=1]"
r; t=0.00 13:02:10

. 
. * ============================================================================
. *  PREDETERMINED COVARIATES (used for balance tests and as RD controls)
. * ============================================================================
. 
. * ---- Demographics ----------------------------------------------------------
. local lbl_female                "Female [=1]"
r; t=0.00 13:02:10

. local lbl_age_panel             "Age (years)"
r; t=0.00 13:02:10

. local lbl_yrseduc               "Years of education"
r; t=0.00 13:02:10

. local lbl_time_col              "Years in Colombia"
r; t=0.00 13:02:10

. local lbl_child_venez           "Has child born in Venezuela [=1]"
r; t=0.00 13:02:10

. 
. * ---- Pre-migration economic conditions (in Venezuela) ----------------------
. local lbl_jobopp                "Had a job offer in Colombia [=1]"
r; t=0.00 13:02:10

. local lbl_labven                "Worked in Venezuela [=1]"
r; t=0.00 13:02:10

. local lbl_typeworkven1          "Worked in agric./manual (VZ) [=1]"
r; t=0.00 13:02:10

. local lbl_typeworkven2          "Worked in services (VZ) [=1]"
r; t=0.00 13:02:10

. local lbl_typeworkven3          "Worked in skilled occ. (VZ) [=1]"
r; t=0.00 13:02:10

. local lbl_written_cont          "Had written contract (VZ) [=1]"
r; t=0.00 13:02:10

. local lbl_average               "Avg. days worked / week (VZ)"
r; t=0.00 13:02:10

. local lbl_smartven              "Owned smartphone in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_owner                 "Homeowner in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_electven              "Had electricity in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_waterven              "Had running water in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_sewageven             "Had sewage in VZ [=1]"
r; t=0.00 13:02:10

. 
. * ---- Family / migration network -------------------------------------------
. local lbl_hhven_parents         "Parents born in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_hhven_spouse          "Spouse born in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_hhven_other           "Other HH members born in VZ [=1]"
r; t=0.00 13:02:10

. local lbl_healthmig             "Healthy at migration [=1]"
r; t=0.00 13:02:10

. local lbl_frdfam                "Network in Colombia [=1]"
r; t=0.00 13:02:10

. r; t=0.01 13:02:10

. 
. di "=================================================================="
==================================================================
r; t=0.00 13:02:10

. di "  11b_PaperTables.do  —  $S_DATE  $S_TIME"
  11b_PaperTables.do  —  25 Jun 2026  13:02:10
r; t=0.00 13:02:10

. di "=================================================================="
==================================================================
r; t=0.00 13:02:10

. 
. /*==============================================================================
>   HELPERS
> ==============================================================================*/
. 
. * Format a coefficient with stars
. capture program drop _coef
r; t=0.00 13:02:10

. program define _coef, rclass
  1.     args b se p
  2.     local s = ""
  3.     if "`p'" != "" & "`p'" != "." & `p' < 0.10 local s "\sym{+}"
  4.     if "`p'" != "" & "`p'" != "." & `p' < 0.05 local s "\sym{*}"
  5.     if "`p'" != "" & "`p'" != "." & `p' < 0.01 local s "\sym{**}"
  6.     if "`b'" == "" | "`b'" == "." {
  7.         return local cell ""
  8.     }
  9.     else {
 10.         return local cell = string(`b', "%6.3f") + "`s'"
 11.     }
 12.     if "`se'" == "" | "`se'" == "." {
 13.         return local secell ""
 14.     }
 15.     else {
 16.         return local secell = "(" + string(`se', "%6.3f") + ")"
 17.     }
 18. end
r; t=0.00 13:02:10

. 
. * Pull a single (coef, se, p, n) from a long-format results file
. capture program drop _get_cell
r; t=0.00 13:02:10

. program define _get_cell, rclass
  1.     args var wave spec
  2.     local b = .
  3.     local s = .
  4.     local p = .
  5.     local n = .
  6.     quietly {
  7.         preserve
  8.         keep if outcome == "`var'" & wave == "`wave'" & spec == "`spec'"
  9.         if _N == 1 {
 10.             local b = coef[1]
 11.             local s = se[1]
 12.             local p = p[1]
 13.             local n = n_eff[1]
 14.         }
 15.         restore
 16.     }
 17.     return scalar b = `b'
 18.     return scalar s = `s'
 19.     return scalar p = `p'
 20.     return scalar n = `n'
 21. end
r; t=0.00 13:02:10

. 
. /*==============================================================================
>   TABLE 2 — Validity (McCrary density + joint balance F)
> ==============================================================================*/
. 
. di ""

r; t=0.00 13:02:10

. di "--- Table 2: validity ---"
--- Table 2: validity ---
r; t=0.00 13:02:10

. 
. * Load the JEEA analysis sample (descriptives table previously did this).
. use "$clean/PEP_Analysis_Sample.dta", clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.14 13:02:10

. local jeea_controls hhven_spouse hhven_other jobopp labven ///
>                     typeworkven1 typeworkven2 typeworkven3 ///
>                     written_cont average yrseduc healthmig frdfam ///
>                     smartven owner electven waterven sewageven female ///
>                     age_panel child_venez time_col
r; t=0.00 13:02:10

. gen sample_roster = .
(13,580 missing values generated)
r; t=0.00 13:02:10

. qui reg trt_hh `jeea_controls'
r; t=2.66 13:02:12

. replace sample_roster = e(sample)
(13,580 real changes made)
r; t=0.00 13:02:12

. replace sample_roster = 0 if gasto_capita == . & trt_hh != .
(119 real changes made)
r; t=0.00 13:02:12

. replace sample_roster = 0 if employed == . & trt_hh != .
(88 real changes made)
r; t=0.00 13:02:12

. replace sample_roster = 0 if hora_semana == . & trt_hh != . & asalariado_num == 1
(64 real changes made)
r; t=0.00 13:02:12

. replace sample_roster = 0 if anx_depr == .
(2 real changes made)
r; t=0.00 13:02:12

. replace sample_roster = 0 if health_pca == .
(8 real changes made)
r; t=0.00 13:02:12

. bysort family_id: egen sample_reg = max(sample_roster)
r; t=0.02 13:02:12

. keep if (orden == 1 | orden == 2) & sample_reg == 1
(6,451 observations deleted)
r; t=0.02 13:02:12

. 
. local mc_T_1 .
r; t=0.00 13:02:12

. local mc_p_1 .
r; t=0.00 13:02:12

. local mc_T_2 .
r; t=0.00 13:02:12

. local mc_p_2 .
r; t=0.00 13:02:12

. foreach w in 1 2 {
  2.     capture rddensity date if wave_num == `w', c(0)
  3.     if !_rc {
  4.         local mc_T_`w' = e(T_q)
  5.         local mc_p_`w' = e(pv_q)
  6.     }
  7. }
r; t=0.24 13:02:13

. 
. gen rd_above = (date >= 0) if !missing(date)
r; t=0.00 13:02:13

. 
. * Multi-bandwidth joint F: ±100, ±60, ±40 days. Excludes electven (problem var).
. local jeea_controls_balance hhven_spouse hhven_other jobopp labven ///
>                             typeworkven1 typeworkven2 typeworkven3 ///
>                             written_cont average yrseduc healthmig frdfam ///
>                             smartven owner waterven sewageven female ///
>                             age_panel child_venez time_col
r; t=0.00 13:02:13

. foreach h in 100 60 40 {
  2.     foreach w in 1 2 {
  3.         local jt_F_`w'_h`h' .
  4.         local jt_p_`w'_h`h' .
  5.         capture qui reg rd_above `jeea_controls_balance' date if wave_num == `w' & abs(date) <= `h'
  6.         if !_rc {
  7.             capture qui test `jeea_controls_balance'
  8.             if !_rc {
  9.                 local jt_F_`w'_h`h' = r(F)
 10.                 local jt_p_`w'_h`h' = r(p)
 11.             }
 12.         }
 13.     }
 14. }
r; t=0.13 13:02:13

. 
. * First-stage discontinuity on PEP take-up (used in Panel C below)
. foreach trt in pep trt_hh {
  2.     foreach w in 1 2 {
  3.         capture rdrobust `trt' date if wave_num == `w', c(0) ///
>             kernel(triangular) bwselect(mserd) p(1)
  4.         if !_rc {
  5.             local fs_`trt'_`w'_b = e(tau_cl)
  6.             local fs_`trt'_`w'_s = e(se_tau_cl)
  7.             local fs_`trt'_`w'_p = e(pv_cl)
  8.             local fs_`trt'_`w'_n = e(N_h_l) + e(N_h_r)
  9.         }
 10.     }
 11. }
r; t=1.11 13:02:14

. 
. file open T using "$ttab/tab2_validity.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Identifying assumptions and first-stage take-up at the RAMV cutoff}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:validity}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{lcc}" _n
r; t=0.00 13:02:14

. file write T "\toprule" _n
r; t=0.00 13:02:14

. file write T " & Wave 1 (2020) & Wave 2 (2021) \\" _n
r; t=0.00 13:02:14

. file write T " & (1) & (2) \\" _n
r; t=0.00 13:02:14

. file write T "\midrule" _n
r; t=0.00 13:02:14

. file write T "\multicolumn{3}{l}{\textit{Panel A. McCrary (2008) density test of the running variable}} \\" _n
r; t=0.00 13:02:14

. file write T "\$T\$-statistic & `=string(`mc_T_1', "%6.3f")' & `=string(`mc_T_2', "%6.3f")' \\" _n
r; t=0.00 13:02:14

. file write T "\$p\$-value & `=string(`mc_p_1', "%6.3f")' & `=string(`mc_p_2', "%6.3f")' \\[0.4em]" _n
r; t=0.00 13:02:14

. file write T "\multicolumn{3}{l}{\textit{Panel B. Joint balance test: regression of eligibility on covariates, \$|
> date|\leq 40\$ days}} \\" _n
r; t=0.00 13:02:14

. local f1 = cond(`jt_F_1_h40' == ., "---", string(`jt_F_1_h40', "%5.3f"))
r; t=0.00 13:02:14

. local p1 = cond(`jt_p_1_h40' == ., "---", string(`jt_p_1_h40', "%5.3f"))
r; t=0.00 13:02:14

. local f2 = cond(`jt_F_2_h40' == ., "---", string(`jt_F_2_h40', "%5.3f"))
r; t=0.00 13:02:14

. local p2 = cond(`jt_p_2_h40' == ., "---", string(`jt_p_2_h40', "%5.3f"))
r; t=0.00 13:02:14

. file write T "\$F\$-statistic & `f1' & `f2' \\" _n
r; t=0.00 13:02:14

. file write T "\$p\$-value (null: covariates do not predict eligibility) & `p1' & `p2' \\" _n
r; t=0.00 13:02:14

. file write T " \\[0.2em]" _n
r; t=0.00 13:02:14

. file write T "\multicolumn{3}{l}{\textit{Panel C. First-stage discontinuity in PEP-RAMV take-up at the cutoff}} \\
> " _n
r; t=0.00 13:02:14

. _coef `fs_pep_1_b' `fs_pep_1_s' `fs_pep_1_p'
r; t=0.00 13:02:14

. local pep1 "`r(cell)'"
r; t=0.00 13:02:14

. local pep1se "`r(secell)'"
r; t=0.00 13:02:14

. _coef `fs_pep_2_b' `fs_pep_2_s' `fs_pep_2_p'
r; t=0.00 13:02:14

. local pep2 "`r(cell)'"
r; t=0.00 13:02:14

. local pep2se "`r(secell)'"
r; t=0.00 13:02:14

. _coef `fs_trt_hh_1_b' `fs_trt_hh_1_s' `fs_trt_hh_1_p'
r; t=0.00 13:02:14

. local hh1 "`r(cell)'"
r; t=0.00 13:02:14

. local hh1se "`r(secell)'"
r; t=0.00 13:02:14

. _coef `fs_trt_hh_2_b' `fs_trt_hh_2_s' `fs_trt_hh_2_p'
r; t=0.00 13:02:14

. local hh2 "`r(cell)'"
r; t=0.00 13:02:14

. local hh2se "`r(secell)'"
r; t=0.00 13:02:14

. file write T "\quad Individual PEP & `pep1' & `pep2' \\" _n
r; t=0.00 13:02:14

. file write T " & `pep1se' & `pep2se' \\" _n
r; t=0.00 13:02:14

. file write T "\quad Household PEP (any HH member) & `hh1' & `hh2' \\" _n
r; t=0.00 13:02:14

. file write T " & `hh1se' & `hh2se' \\" _n
r; t=0.00 13:02:14

. file write T "\quad Effective N (individual / HH) & `fs_pep_1_n' / `fs_trt_hh_1_n' & `fs_pep_2_n' / `fs_trt_hh_2_n
> ' \\" _n
r; t=0.00 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "\item \textit{Notes}: This table reports the two main identifying-assumption tests of the fuzzy regr
> ession-discontinuity design at the RAMV registration deadline of June 8, 2018, together with the first-stage disco
> ntinuity in PEP-RAMV take-up. \textit{Panel A} reports the McCrary (2008) local-polynomial density test for manipu
> lation of the running variable at the cutoff, computed with the \texttt{rddensity} package using its default local
> -quadratic fit and jackknife variance. The null is no manipulation; large \$p\$-values support the assumption that
>  households cannot precisely manipulate their arrival date relative to the deadline. \textit{Panel B} reports the 
> joint \$F\$-test of the eligibility indicator on the pre-migration covariate set, estimated by OLS on the JEEA-sty
> le analysis sample within three running-variable windows: \$|\textit{date}| \leq 100\$, 60, and 40 days. Local ran
> domness requires balance as the bandwidth narrows toward the cutoff. \textit{Panel C} reports the sharp regression
> -discontinuity in PEP-RAMV take-up at the cutoff (\texttt{rdrobust} at the MSE-optimal bandwidth, triangular kerne
> l, local-linear polynomial); the coefficient is the first-stage discontinuity that scales the fuzzy LATE in the bo
> dy tables. Per-covariate balance is reported in Table~\ref{tab:balance_full}. Significance: \sym{+} \$p<0.10\$, \s
> ym{*} \$p<0.05\$, \sym{**} \$p<0.01\$." _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. 
. di "  tab2_validity.tex saved (combined McCrary + balance + first-stage)"
  tab2_validity.tex saved (combined McCrary + balance + first-stage)
r; t=0.00 13:02:14

. 
. /*==============================================================================
>   TABLES 3 & 4 — Main RD results (4 columns x panels)
> 
>   Columns: W1 NC, W1 +X, W2 NC, W2 +X
> ==============================================================================*/
. 
. * Load the long-format RD results and reshape to wide
. import delimited "$out/07_RD_W1_W2_results.txt", clear delimiter(tab) ///
>     varnames(1) stringcols(1 2 3 4)
(encoding automatically selected: ISO-8859-1)
(14 vars, 260 obs)
r; t=0.16 13:02:14

. destring coef se p p_rb n_eff h_l h_r n_l n_r ctrl_mean, replace force
coef already numeric; no replace
se already numeric; no replace
p already numeric; no replace
p_rb already numeric; no replace
n_eff already numeric; no replace
h_l already numeric; no replace
h_r already numeric; no replace
n_l already numeric; no replace
n_r already numeric; no replace
ctrl_mean already numeric; no replace
r; t=0.00 13:02:14

. 
. tempfile rd_long
r; t=0.00 13:02:14

. save `rd_long'
file C:\Users\wb614536\AppData\Local\Temp\ST_7cc4_000001.tmp saved as .dta format
r; t=0.01 13:02:14

. 
. /*------------------------------------------------------------------
>   Load first-differences fuzzy-RD results (22c_FirstDiffMain.do) and
>   store as globals indexed by outcome name. Used to populate the
>   fourth column of the per-domain RD tables (Tables 3-9 and summary).
> ------------------------------------------------------------------*/
. capture confirm file "$out/22c_fd_main_results.dta"
r; t=0.00 13:02:14

. if _rc == 0 {
.     preserve
r; t=0.00 13:02:14
.     use "$out/22c_fd_main_results.dta", clear
r; t=0.00 13:02:14
.     forvalues r = 1/`=_N' {
  2.         local v = outcome[`r']
  3.         global fd_b_`v' = coef[`r']
  4.         global fd_s_`v' = se[`r']
  5.         global fd_p_`v' = pv[`r']
  6.         global fd_n_`v' = n[`r']
  7.     }
r; t=0.00 13:02:14
.     restore
r; t=0.00 13:02:14
.     di "  FD results loaded: `=_N' outcomes from 22c_fd_main_results.dta"
r; t=0.00 13:02:14
. }
r; t=0.00 13:02:14

. else {
.     di as err "  WARNING: $out/22c_fd_main_results.dta not found - FD column will be empty."
  WARNING: ../outputs/22c_fd_main_results.dta not found - FD column will be empty.
r; t=0.00 13:02:14
. }
r; t=0.00 13:02:14

. 
. * Pull richer per-cell info: coef, se, p, p_rb, n_eff, h_l, ctrl_mean
. capture program drop _get_cell_rich
r; t=0.00 13:02:14

. program define _get_cell_rich, rclass
  1.     args var wave spec
  2.     local b   = .
  3.     local s   = .
  4.     local p   = .
  5.     local prb = .
  6.     local n   = .
  7.     local h   = .
  8.     local cm  = .
  9.     quietly {
 10.         preserve
 11.         keep if outcome == "`var'" & wave == "`wave'" & spec == "`spec'"
 12.         if _N == 1 {
 13.             local b   = coef[1]
 14.             local s   = se[1]
 15.             local p   = p[1]
 16.             local prb = p_rb[1]
 17.             local n   = n_eff[1]
 18.             local h   = h_l[1]
 19.             local cm  = ctrl_mean[1]
 20.         }
 21.         restore
 22.     }
 23.     return scalar b   = `b'
 24.     return scalar s   = `s'
 25.     return scalar p   = `p'
 26.     return scalar prb = `prb'
 27.     return scalar n   = `n'
 28.     return scalar h   = `h'
 29.     return scalar cm  = `cm'
 30. end
r; t=0.00 13:02:14

. 
. * Helper: compute Benjamini-Hochberg q-values for a set of p-values within
. * one (wave, spec) family. Stores results in q_<var>_<key> globals so the
. * table-builder can look them up later.
. capture program drop _compute_bh_qvals
r; t=0.00 13:02:14

. program define _compute_bh_qvals
  1.     args outvars wave spec key
  2.     local n_test : word count `outvars'
  3.     if `n_test' == 0 exit
  4. 
.     * Collect (var, p) pairs in a tempfile
.     preserve
  5.     drop _all
  6.     set obs `n_test'
  7.     gen str40 var = ""
  8.     gen double p  = .
  9.     local i = 0
 10.     foreach v of local outvars {
 11.         local ++i
 12.         replace var = "`v'" in `i'
 13.         * Look up p from the global rd_long dataset (passed as data set in caller)
.         quietly count if outcome == "`v'" & wave == "`wave'" & spec == "`spec'"
 14.         * The caller has the rd_long loaded; we need to access it differently.
.     }
 15.     restore
 16. end
r; t=0.00 13:02:14

. 
. * Simpler in-place approach: compute q-values *outside* a program, using the
. * full rd_long dataset directly. The helper below computes BH q-values for
. * a given (outcomes, wave, spec) family and writes them to global macros
. * named q_<var>_<key>. Used as a fallback when RW q-values are unavailable.
. capture program drop _bh_qvals_inplace
r; t=0.00 13:02:14

. program define _bh_qvals_inplace
  1.     args outvars wave spec key
  2.     local n_test : word count `outvars'
  3.     if `n_test' == 0 exit
  4. 
.     preserve
  5.     keep if wave == "`wave'" & spec == "`spec'"
  6.     keep if outcome != ""
  7. 
.     gen include = 0
  8.     foreach v of local outvars {
  9.         replace include = 1 if outcome == "`v'"
 10.     }
 11.     keep if include == 1
 12.     keep outcome p
 13.     rename outcome var
 14. 
.     qui count if !missing(p)
 15.     local m = r(N)
 16.     if `m' == 0 {
 17.         restore
 18.         exit
 19.     }
 20. 
.     sort p
 21.     gen rank = _n if !missing(p)
 22.     gen q_step = p * `m' / rank if !missing(p) & rank > 0
 23.     gsort -rank
 24.     gen q = q_step
 25.     forvalues k = 2/`m' {
 26.         replace q = min(q, q[_n-1]) in `k'
 27.     }
 28.     sort var
 29.     forvalues j = 1/`=_N' {
 30.         local nm = var[`j']
 31.         local qval = q[`j']
 32.         local qstr = cond(missing(`qval'), "", string(min(`qval', 1), "%5.3f"))
 33.         global q_`nm'_`key' "`qstr'"
 34.     }
 35.     restore
 36. end
r; t=0.00 13:02:14

. 
. /*------------------------------------------------------------------
>   RW q-value override: if 19_RomanoWolf_qvals.txt exists, build a
>   tempfile with (outcome, wave, q_rw) and define a helper that
>   overwrites q_<var>_<key> globals with RW values for the outcomes
>   in a given family. This is called AFTER _bh_qvals_inplace within
>   each table block so RW overrides BH whenever available.
> ------------------------------------------------------------------*/
. 
. global HAS_RW_QVALS 0
r; t=0.00 13:02:14

. capture confirm file "$out/19_RomanoWolf_qvals.txt"
r; t=0.00 13:02:14

. if _rc == 0 {
.     preserve
r; t=0.00 13:02:14
.     import delimited "$out/19_RomanoWolf_qvals.txt", clear delimiter(tab) ///
>         varnames(1) stringcols(1 2)
r; t=0.00 13:02:14
.     capture destring q_rw, replace force
r; t=0.00 13:02:14
.     * Some outcomes appear in multiple table families (e.g., health_pca in
.     * both wellbeing and health). Keep the first occurrence per (outcome,
.     * wave) by original file row order so the override picks a deterministic
.     * value -- the wellbeing-family q-value for health_pca, which is the
.     * smaller (more powered) family and the one matching the headline table.
.     gen long _origrow = _n
r; t=0.00 13:02:14
.     bysort outcome wave (_origrow): keep if _n == 1
r; t=0.00 13:02:14
.     drop _origrow
r; t=0.00 13:02:14
.     tempfile rwfile
r; t=0.00 13:02:14
.     save `rwfile'
r; t=0.00 13:02:14
.     restore
r; t=0.00 13:02:14
.     global RW_PATH "`rwfile'"
r; t=0.00 13:02:14
.     global HAS_RW_QVALS 1
r; t=0.00 13:02:14
.     di "  RW q-values file found and saved to: $RW_PATH"
r; t=0.00 13:02:14
. }
r; t=0.00 13:02:14

. else {
.     di "  19_RomanoWolf_qvals.txt not found -> reporting BH q-values only"
  19_RomanoWolf_qvals.txt not found -> reporting BH q-values only
r; t=0.00 13:02:14
. }
r; t=0.00 13:02:14

. 
. capture program drop _rw_qvals_override
r; t=0.00 13:02:14

. program define _rw_qvals_override
  1.     args outvars wave key
  2.     if "$HAS_RW_QVALS" != "1" exit
  3.     preserve
  4.     use "$RW_PATH", clear
  5.     keep if wave == "`wave'"
  6.     foreach v of local outvars {
  7.         qui sum q_rw if outcome == "`v'", meanonly
  8.         if r(N) == 1 & !missing(r(mean)) {
  9.             global q_`v'_`key' = string(min(r(mean), 1), "%5.3f")
 10.         }
 11.     }
 12.     restore
 13. end
r; t=0.00 13:02:14

. 
. * Helper: print one outcome's JEEA-style block to a table file (JEEA Table 4 layout).
. * Rows per outcome: Label [Trt] | Coef + SE | RW q-value | First-stage | Mean | N
. * Treatment unit shown as suffix on label and used to pick the correct first-stage value.
. * Q-values are looked up from globals q_<var>_<key>.
. capture program drop _print_rd_row
r; t=0.00 13:02:14

. program define _print_rd_row
  1.     args fhandle var label trt
  2.     if "`trt'" == ""  local trt "pep"
  3.     if "`trt'" == "pep"     local trt_lbl "Ind."
  4.     if "`trt'" == "trt_hh"  local trt_lbl "HH"
  5. 
.     local cells_b   ""
  6.     local cells_se  ""
  7.     local cells_q   ""
  8.     local cells_fs  ""
  9.     local cells_cm  ""
 10.     local cells_n   ""
 11. 
.     * Cache numeric W1/W2 estimates for the diff-in-coefs test.
.     local b_W1_num = .
 12.     local s_W1_num = .
 13.     local b_W2_num = .
 14.     local s_W2_num = .
 15. 
.     foreach key in A C {
 16.         if "`key'" == "A" {
 17.             local wv "W1"
 18.             local sp "no_ctrls"
 19.             local wcode "W1"
 20.         }
 21.         else {
 22.             local wv "W2"
 23.             local sp "no_ctrls"
 24.             local wcode "W2"
 25.         }
 26.         _get_cell_rich `var' `wv' `sp'
 27.         local b_val   = r(b)
 28.         local s_val   = r(s)
 29.         local p_val   = r(p)
 30.         local n_val   = r(n)
 31.         local cm_val  = r(cm)
 32. 
.         if "`wcode'" == "W1" {
 33.             local b_W1_num = `b_val'
 34.             local s_W1_num = `s_val'
 35.         }
 36.         else {
 37.             local b_W2_num = `b_val'
 38.             local s_W2_num = `s_val'
 39.         }
 40. 
.         _coef `b_val' `s_val' `p_val'
 41.         local cells_b   "`cells_b' & `r(cell)'"
 42.         local cells_se  "`cells_se' & `r(secell)'"
 43. 
.         local q_cell "${q_`var'_`key'}"
 44.         if "`q_cell'" == "" {
 45.             local q_disp ""
 46.         }
 47.         else {
 48.             local q_disp "[`q_cell']"
 49.         }
 50.         local cells_q "`cells_q' & `q_disp'"
 51. 
.         * First-stage for this outcome's treatment unit and wave
.         if "`trt'" == "pep"     local fs_b "${fs_pep_`wcode'}"
 52.         if "`trt'" == "trt_hh"  local fs_b "${fs_hh_`wcode'}"
 53.         local cells_fs "`cells_fs' & `fs_b'"
 54. 
.         local cm_cell = cond("`cm_val'" == ".", "", string(`cm_val', "%6.3f"))
 55.         local cells_cm "`cells_cm' & `cm_cell'"
 56. 
.         local n_cell = cond("`n_val'" == ".", "", "`n_val'")
 57.         local cells_n "`cells_n' & `n_cell'"
 58.     }
 59. 
.     * Difference-in-coefficients test: Delta = b_W2 - b_W1, SE under
.     * independence = sqrt(s_W1^2 + s_W2^2), two-sided normal p-value.
.     local diff_cell  ""
 60.     local diff_se    ""
 61.     local diff_p     ""
 62.     if `b_W1_num' != . & `b_W2_num' != . & `s_W1_num' != . & `s_W2_num' != . {
 63.         local diff   = `b_W2_num' - `b_W1_num'
 64.         local se_d   = sqrt(`s_W1_num'^2 + `s_W2_num'^2)
 65.         local pval_d = 2 * (1 - normal(abs(`diff'/`se_d')))
 66.         local stars  ""
 67.         if `pval_d' < 0.10 local stars "\sym{+}"
 68.         if `pval_d' < 0.05 local stars "\sym{*}"
 69.         if `pval_d' < 0.01 local stars "\sym{**}"
 70.         local diff_cell = string(`diff', "%6.3f") + "`stars'"
 71.         local diff_se   = "(" + string(`se_d', "%6.3f") + ")"
 72.         local diff_p    = "[" + string(`pval_d', "%5.3f") + "]"
 73.     }
 74. 
.     file write `fhandle' "`label' \textnormal{[`trt_lbl']}" "`cells_b' & `diff_cell'" " \\" _n
 75.     file write `fhandle' " " "`cells_se' & `diff_se'" " \\" _n
 76.     file write `fhandle' " \quad BH \(q\)-value" "`cells_q' & `diff_p'" " \\" _n
 77.     file write `fhandle' " \quad First-stage" "`cells_fs' & " " \\" _n
 78.     file write `fhandle' " \quad Mean of dep.\ var.\ (control)" "`cells_cm' & " " \\" _n
 79.     file write `fhandle' " \quad Effective obs." "`cells_n' & " " \\[0.4em]" _n
 80. end
r; t=0.00 13:02:14

. 
. /*------------------------------------------------------------------
>   Common notes for the 4 RD tables
> ------------------------------------------------------------------*/
. 
. * Common AER-style notes: kept short. Per-row content (coef/SE/q-value/FS/control mean/N)
. * and full estimator details are documented in the body text and Online Appendix.
. local note_common "Each block reports the fuzzy-RD coefficient (conventional-\(p\) stars), the robust standard err
> or (parentheses), the within-group Benjamini-Hochberg \(q\)-value (brackets), the first-stage take-up jump, the co
> ntrol-side mean within bandwidth, and the effective sample size. \textnormal{[Ind.]} and \textnormal{[HH]} denote 
> individual and household PEP-RAMV. Estimator: \texttt{rdrobust} with triangular kernel, \(p=1\), MSE-optimal bandw
> idth. Running variable: days from the June 8, 2018 cutoff, signed so positive values are eligible arrivals. \(\Del
> ta\)~column~(3): difference of column~(2) and column~(1) under independence. \sym{+} \(p<0.10\), \sym{*} \(p<0.05\
> ), \sym{**} \(p<0.01\)."
r; t=0.00 13:02:14

. 
. local note3 "\item \textit{Notes}: Fuzzy-RD estimates on socioeconomic well-being (JEEA Table 4 outcomes): a stand
> ardized index, log monthly labor income, log per-capita household consumption, and the health PCA index. Per-capit
> a consumption uses household PEP; other outcomes use individual PEP. `note_common'"
r; t=0.00 13:02:14

. 
. local note4 "\item \textit{Notes}: Fuzzy-RD estimates on access to formal services. The service access index avera
> ges SISBEN registration, subsidized health, and government transfers, each standardized to the within-wave control
>  distribution. Banking access is excluded from this index and reported with the financial-access index in the Onli
> ne Appendix. Government transfers use household PEP; other outcomes use individual PEP. `note_common'"
r; t=0.00 13:02:14

. 
. local note5 "\item \textit{Notes}: Fuzzy-RD estimates on labor-market outcomes (JEEA Table 6 outcomes): the labor 
> index, indicators for being currently employed and formally employed (contributes to social security), and log wee
> kly hours conditional on salaried work. Treatment: individual PEP. `note_common'"
r; t=0.00 13:02:14

. 
. local note6 "\item \textit{Notes}: Fuzzy-RD estimates on social integration in the host community: a standardized 
> integration index (average of belonging, feels-integrated, count of Colombian friends, community-organization memb
> ership, and connection to Colombia, each standardized), the four Likert components, and a connection indicator. Tr
> ust outcomes are reported in Table~\ref{tab:rd_trust}. Treatment: individual PEP. `note_common'"
r; t=0.00 13:02:14

. 
. local note7 "\item \textit{Notes}: Fuzzy-RD estimates on prosocial behaviors and social trust: a standardized trus
> t composite (average of standardized general trust, trust in Colombians, and trust in Venezuelans) and the five 1-
> -5 Likert components (general trust, trust in Colombians and Venezuelans, perceived helpfulness of Colombians and 
> Venezuelans). Treatment: individual PEP. `note_common'"
r; t=0.00 13:02:14

. 
. local note8 "\item \textit{Notes}: Fuzzy-RD estimates on food security: the food-security index, indicators for sk
> ipping meals last month and going without food, and days per week with protein. Treatment: individual PEP. `note_c
> ommon'"
r; t=0.00 13:02:14

. 
. local note_health "\item \textit{Notes}: Fuzzy-RD estimates on mental and physical health. The mental-health compo
> site averages standardized life satisfaction (0--10), inverted EQ-5D anxiety/depression (5--low to 1--high), inver
> ted any-anxiety-or-depression, and the visual-analog self-rated health score (0--100). The health PCA index is the
>  JEEA-style first principal component of the disaggregated items. Treatment: individual PEP. `note_common'"
r; t=0.00 13:02:14

. 
. /*------------------------------------------------------------------
>   First-stage values to report at the bottom of each main RD table.
>   These are sharp-RD estimates of PEP take-up at the cutoff (\rdrobust\,
>   triangular kernel, p=1, MSE-optimal bandwidth), separately by wave
>   and by treatment unit (individual PEP vs household PEP).
>   Source: 06_FirstStage.do / tabA_first_stage.tex.
> ------------------------------------------------------------------*/
. local fs_pep_W1   "0.413\sym{**}"
r; t=0.00 13:02:14

. local fs_pep_W1se "(0.058)"
r; t=0.00 13:02:14

. local fs_pep_W2   "0.453\sym{**}"
r; t=0.00 13:02:14

. local fs_pep_W2se "(0.073)"
r; t=0.00 13:02:14

. local fs_hh_W1    "0.431\sym{**}"
r; t=0.00 13:02:14

. local fs_hh_W1se  "(0.057)"
r; t=0.00 13:02:14

. local fs_hh_W2    "0.501\sym{**}"
r; t=0.00 13:02:14

. local fs_hh_W2se  "(0.064)"
r; t=0.00 13:02:14

. 
. * Helper: write a first-stage block at the bottom of an RD table.
. * Argument trt: "pep", "hh", or "both".
. capture program drop _write_first_stage
r; t=0.00 13:02:14

. program define _write_first_stage
  1.     args fhandle trt
  2.     file write `fhandle' "\midrule" _n
  3.     if "`trt'" == "pep" {
  4.         file write `fhandle' "First-stage (PEP, ind.)" ///
>             " & ${fs_pep_W1} & ${fs_pep_W2} \\" _n
  5.         file write `fhandle' " & ${fs_pep_W1se} & ${fs_pep_W2se} \\" _n
  6.     }
  7.     else if "`trt'" == "hh" {
  8.         file write `fhandle' "First-stage (PEP, HH)" ///
>             " & ${fs_hh_W1} & ${fs_hh_W2} \\" _n
  9.         file write `fhandle' " & ${fs_hh_W1se} & ${fs_hh_W2se} \\" _n
 10.     }
 11.     else {
 12.         file write `fhandle' "First-stage (PEP, ind.)" ///
>             " & ${fs_pep_W1} & ${fs_pep_W2} \\" _n
 13.         file write `fhandle' " & ${fs_pep_W1se} & ${fs_pep_W2se} \\" _n
 14.         file write `fhandle' "First-stage (PEP, HH)" ///
>             " & ${fs_hh_W1} & ${fs_hh_W2} \\" _n
 15.         file write `fhandle' " & ${fs_hh_W1se} & ${fs_hh_W2se} \\" _n
 16.     }
 17. end
r; t=0.00 13:02:14

. 
. * Promote the first-stage locals to globals so the helper can read them.
. global fs_pep_W1   "`fs_pep_W1'"
r; t=0.00 13:02:14

. global fs_pep_W1se "`fs_pep_W1se'"
r; t=0.00 13:02:14

. global fs_pep_W2   "`fs_pep_W2'"
r; t=0.00 13:02:14

. global fs_pep_W2se "`fs_pep_W2se'"
r; t=0.00 13:02:14

. global fs_hh_W1    "`fs_hh_W1'"
r; t=0.00 13:02:14

. global fs_hh_W1se  "`fs_hh_W1se'"
r; t=0.00 13:02:14

. global fs_hh_W2    "`fs_hh_W2'"
r; t=0.00 13:02:14

. global fs_hh_W2se  "`fs_hh_W2se'"
r; t=0.00 13:02:14

. 
. /*------------------------------------------------------------------
>   Helper: write the table header (column titles and rules)
> ------------------------------------------------------------------*/
. 
. capture program drop _write_rd_header
r; t=0.00 13:02:14

. program define _write_rd_header
  1.     args fhandle ncols
  2.     file write `fhandle' "\toprule" _n
  3.     file write `fhandle' " & Wave 1 (2020) & Wave 2 (2021) & \(\Delta\) (W2\(-\)W1) \\" _n
  4.     file write `fhandle' " & (1) & (2) & (3) \\" _n
  5.     file write `fhandle' "\midrule" _n
  6. end
r; t=0.00 13:02:14

. 
. /*------------------------------------------------------------------
>   Build the 5 main RD tables (inline, no helper program)
> 
>   Each block: load rd_long, compute BH q-values for the 4 (wave,spec)
>   families, then write the table file.
> ------------------------------------------------------------------*/
. 
. * Generic block: each table is structurally identical, only varying in
. * (filename, tex label, caption, outvar list, note local). Inlined to avoid
. * multi-word-argument issues in Stata `args`.
. 
. * ── Table summary — Headline indices across the seven outcome groups ─
. di ""

r; t=0.00 13:02:14

. di "--- Table 3: summary across indices ---"
--- Table 3: summary across indices ---
r; t=0.00 13:02:14

. 
. local out_summary jeea_index_wellbeing jeea_index_services jeea_index_labor index_integration trust_index index_fo
> od index_housing
r; t=0.00 13:02:14

. local trts_summary pep pep pep pep pep pep pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     else {
  7.         local wv "W2"
  8.         local sp "no_ctrls"
  9.     }
 10.     _bh_qvals_inplace "`out_summary'" "`wv'" "`sp'" "`key'"
 11. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(58 observations deleted)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(58 observations deleted)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.05 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab3_summary.tex", write replace text
(file ../outputs/tables/tab3_summary.tex not found)
r; t=0.00 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Summary of fuzzy regression-discontinuity estimates across the seven thematic indices}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_summary}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 4
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_summary {
  2.     local ++k
  3.     local trt : word `k' of `trts_summary'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "\item \textit{Notes}: Fuzzy-RD estimates for the seven thematic indices. Each row reports a standard
> ized index for one outcome group; underlying components are in Tables~\ref{tab:rd_wellbeing}--\ref{tab:rd_housing}
> . `note_common'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab3_summary.tex saved"
  tab3_summary.tex saved
r; t=0.00 13:02:14

. 
. * ── Table 4 — Well-being (JEEA Table 4 outcome list) ──────────────
. di ""

r; t=0.00 13:02:14

. di "--- Table 4: well-being ---"
--- Table 4: well-being ---
r; t=0.00 13:02:14

. * Economic well-being: index (income + consumption only) + components
. local out_t3 jeea_index_wellbeing labour_income gasto_capita health_pca
r; t=0.00 13:02:14

. local trts_t3 pep pep trt_hh pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     if "`key'" == "B" {
  7.         local wv "W1"
  8.         local sp "with_ctrls"
  9.     }
 10.     if "`key'" == "C" {
 11.         local wv "W2"
 12.         local sp "no_ctrls"
 13.     }
 14.     if "`key'" == "D" {
 15.         local wv "W2"
 16.         local sp "with_ctrls"
 17.     }
 18.     _bh_qvals_inplace "`out_t3'" "`wv'" "`sp'" "`key'"
 19. *    _rw_qvals_override "`out_t3'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(61 observations deleted)
(0 real changes made)
(0 real changes made)
(1 real change made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(61 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab3_wellbeing.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: socioeconomic well-being}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_wellbeing}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 4
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t3 {
  2.     local ++k
  3.     local trt : word `k' of `trts_t3'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note3'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab3_wellbeing.tex saved"
  tab3_wellbeing.tex saved
r; t=0.00 13:02:14

. 
. * ── Table 4 — Services and rights (JEEA Table 5 outcome list) ─────
. di ""

r; t=0.00 13:02:14

. di "--- Table 4: service access ---"
--- Table 4: service access ---
r; t=0.00 13:02:14

. * Service access index excludes banking (now reported with financial access
. * in the appendix). Rows: index, SISBEN, subsidized health, govt transfers.
. local out_t4 jeea_index_services sisben subs govtr
r; t=0.00 13:02:14

. local trts_t4 pep pep pep trt_hh
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     if "`key'" == "B" {
  7.         local wv "W1"
  8.         local sp "with_ctrls"
  9.     }
 10.     if "`key'" == "C" {
 11.         local wv "W2"
 12.         local sp "no_ctrls"
 13.     }
 14.     if "`key'" == "D" {
 15.         local wv "W2"
 16.         local sp "with_ctrls"
 17.     }
 18.     _bh_qvals_inplace "`out_t4'" "`wv'" "`sp'" "`key'"
 19. *    _rw_qvals_override "`out_t4'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(61 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(61 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab4_services.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: services and rights}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_services}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 4
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t4 {
  2.     local ++k
  3.     local trt : word `k' of `trts_t4'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note4'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab4_services.tex saved"
  tab4_services.tex saved
r; t=0.00 13:02:14

. 
. * ── Table 5 — Labor market (JEEA Table 6 outcome list) ───────────
. di ""

r; t=0.00 13:02:14

. di "--- Table 5: labor ---"
--- Table 5: labor ---
r; t=0.00 13:02:14

. * Labor: includes labour_income (duplicated from well-being block) + employment + formal + hours
. local out_t5 jeea_index_labor labour_income employed formal hora_semana
r; t=0.00 13:02:14

. local trts_t5 pep pep pep pep pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     if "`key'" == "B" {
  7.         local wv "W1"
  8.         local sp "with_ctrls"
  9.     }
 10.     if "`key'" == "C" {
 11.         local wv "W2"
 12.         local sp "no_ctrls"
 13.     }
 14.     if "`key'" == "D" {
 15.         local wv "W2"
 16.         local sp "with_ctrls"
 17.     }
 18.     _bh_qvals_inplace "`out_t5'" "`wv'" "`sp'" "`key'"
 19. *    _rw_qvals_override "`out_t5'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(60 observations deleted)
(0 real changes made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(60 observations deleted)
(0 real changes made)
(0 real changes made)
(1 real change made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab5_labor.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: labor market}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_labor}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 4
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t5 {
  2.     local ++k
  3.     local trt : word `k' of `trts_t5'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note5'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab5_labor.tex saved"
  tab5_labor.tex saved
r; t=0.00 13:02:14

. 
. * ── Table 6 — Integration ──────────────────────────────────
. di ""

r; t=0.00 13:02:14

. di "--- Table 6: integration ---"
--- Table 6: integration ---
r; t=0.00 13:02:14

. local out_t6 index_integration belonging feel_integrated col_friends community_org connection_colombia
r; t=0.00 13:02:14

. local trts_t6 pep pep pep pep pep pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     if "`key'" == "B" {
  7.         local wv "W1"
  8.         local sp "with_ctrls"
  9.     }
 10.     if "`key'" == "C" {
 11.         local wv "W2"
 12.         local sp "no_ctrls"
 13.     }
 14.     if "`key'" == "D" {
 15.         local wv "W2"
 16.         local sp "with_ctrls"
 17.     }
 18.     _bh_qvals_inplace "`out_t6'" "`wv'" "`sp'" "`key'"
 19. *    _rw_qvals_override "`out_t6'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(59 observations deleted)
(1 missing value generated)
(1 missing value generated)
(1 missing value generated)
(1 real change made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(59 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab6_integration.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: integration}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_integration}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 4
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t6 {
  2.     local ++k
  3.     local trt : word `k' of `trts_t6'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note6'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab6_integration.tex saved"
  tab6_integration.tex saved
r; t=0.00 13:02:14

. 
. * ── Table 7 — Prosocial behaviors ─────────────────────────────────
. di ""

r; t=0.00 13:02:14

. di "--- Table 7: prosocial behaviors ---"
--- Table 7: prosocial behaviors ---
r; t=0.00 13:02:14

. local out_t7trust trust_index general_trust trust_col trust_ven colombians_help_me venezuelans_help_me
r; t=0.00 13:02:14

. local trts_t7trust pep pep pep pep pep pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     else {
  7.         local wv "W2"
  8.         local sp "no_ctrls"
  9.     }
 10.     _bh_qvals_inplace "`out_t7trust'" "`wv'" "`sp'" "`key'"
 11. *    _rw_qvals_override "`out_t7trust'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(0 real changes made)
(1 real change made)
(60 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(0 real changes made)
(1 real change made)
(60 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab7_trust.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: prosocial behaviors}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_trust}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 2
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t7trust {
  2.     local ++k
  3.     local trt : word `k' of `trts_t7trust'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note7'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab7_trust.tex saved"
  tab7_trust.tex saved
r; t=0.00 13:02:14

. 
. * ── Table 8 — Food security ───────────────────────────────────────
. di ""

r; t=0.00 13:02:14

. di "--- Table 8: food security ---"
--- Table 8: food security ---
r; t=0.00 13:02:14

. local out_t7 index_food skip_meals went_without_food protein_days
r; t=0.00 13:02:14

. local trts_t7 pep pep pep pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     if "`key'" == "B" {
  7.         local wv "W1"
  8.         local sp "with_ctrls"
  9.     }
 10.     if "`key'" == "C" {
 11.         local wv "W2"
 12.         local sp "no_ctrls"
 13.     }
 14.     if "`key'" == "D" {
 15.         local wv "W2"
 16.         local sp "with_ctrls"
 17.     }
 18.     _bh_qvals_inplace "`out_t7'" "`wv'" "`sp'" "`key'"
 19. *    _rw_qvals_override "`out_t7'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(61 observations deleted)
(1 real change made)
(1 real change made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(61 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab8_food.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: food security}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_food}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 4
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t7 {
  2.     local ++k
  3.     local trt : word `k' of `trts_t7'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.01 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note8'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab8_food.tex saved"
  tab8_food.tex saved
r; t=0.00 13:02:14

. 
. * ── Appendix table — Mental and physical health (composite + disagg) ──
. * Health table is appendix-only; composite + disaggregated items in one table.
. di ""

r; t=0.00 13:02:14

. di "--- Appendix: mental and physical health (composite + disaggregated) ---"
--- Appendix: mental and physical health (composite + disaggregated) ---
r; t=0.00 13:02:14

. local out_health health_pca hi5_inv vas_score
r; t=0.00 13:02:14

. local trts_health pep pep pep
r; t=0.00 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     else {
  7.         local wv "W2"
  8.         local sp "no_ctrls"
  9.     }
 10.     _bh_qvals_inplace "`out_health'" "`wv'" "`sp'" "`key'"
 11. *    _rw_qvals_override "`out_health'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(62 observations deleted)
(0 real changes made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(62 observations deleted)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$atab/tabA_rd_health.tex", write replace text
(file ../outputs/appendix/tables/tabA_rd_health.tex not found)
r; t=0.00 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: mental and physical health (composite and disaggr
> egated items)}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_health}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 2
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_health {
  2.     local ++k
  3.     local trt : word `k' of `trts_health'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.01 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note_health'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tabA_rd_health.tex saved (appendix)"
  tabA_rd_health.tex saved (appendix)
r; t=0.00 13:02:14

. 
. * ── Table 9 — Housing quality ──────────────────────────────────────
. di ""

r; t=0.00 13:02:14

. di "--- Table 9: housing quality ---"
--- Table 9: housing quality ---
r; t=0.00 13:02:14

. local out_t9 index_housing adequate_housing has_electricity has_water has_sewage
r; t=0.00 13:02:14

. local trts_t9 pep pep pep pep pep
r; t=0.00 13:02:14

. local note9 "\item \textit{Notes}: Fuzzy-RD estimates on housing quality: the housing-quality index, an indicator 
> for adequate housing, and indicators for electricity, running water, and sewage. Treatment: individual PEP. `note_
> common'"
r; t=0.00 13:02:14

. 
. use `rd_long', clear
r; t=0.00 13:02:14

. foreach key in A C {
  2.     if "`key'" == "A" {
  3.         local wv "W1"
  4.         local sp "no_ctrls"
  5.     }
  6.     else {
  7.         local wv "W2"
  8.         local sp "no_ctrls"
  9.     }
 10.     _bh_qvals_inplace "`out_t9'" "`wv'" "`sp'" "`key'"
 11. *    _rw_qvals_override "`out_t9'" "`wv'" "`key'"
. }
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(60 observations deleted)
(1 real change made)
(1 real change made)
(0 real changes made)
(0 real changes made)
(195 observations deleted)
(0 observations deleted)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(1 real change made)
(60 observations deleted)
(0 real changes made)
(0 real changes made)
(0 real changes made)
(0 real changes made)
r; t=0.01 13:02:14

. use `rd_long', clear
r; t=0.00 13:02:14

. file open T using "$ttab/tab9_housing.tex", write replace text
r; t=0.01 13:02:14

. file write T "\begin{table}[!htbp]" _n
r; t=0.00 13:02:14

. file write T "\centering" _n
r; t=0.00 13:02:14

. file write T "\caption{Fuzzy regression-discontinuity estimates: housing quality}" _n
r; t=0.00 13:02:14

. file write T "\label{tab:rd_housing}" _n
r; t=0.00 13:02:14

. file write T "\begin{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\begin{tabular}{l*{3}{c}}" _n
r; t=0.00 13:02:14

. _write_rd_header T 2
r; t=0.00 13:02:14

. local k = 0
r; t=0.00 13:02:14

. foreach v of local out_t9 {
  2.     local ++k
  3.     local trt : word `k' of `trts_t9'
  4.     local pretty "`lbl_`v''"
  5.     if "`pretty'" == "" local pretty "`v'"
  6.     _print_rd_row T `v' "`pretty'" `trt'
  7. }
r; t=0.02 13:02:14

. file write T "\bottomrule" _n
r; t=0.00 13:02:14

. file write T "\end{tabular}" _n
r; t=0.00 13:02:14

. file write T "\begin{tablenotes}\footnotesize" _n
r; t=0.00 13:02:14

. file write T "`note9'" _n
r; t=0.00 13:02:14

. file write T "\end{tablenotes}" _n
r; t=0.00 13:02:14

. file write T "\end{threeparttable}" _n
r; t=0.00 13:02:14

. file write T "\end{table}" _n
r; t=0.00 13:02:14

. file close T
r; t=0.00 13:02:14

. di "  tab9_housing.tex saved"
  tab9_housing.tex saved
r; t=0.00 13:02:14

. 
. 
. di ""

r; t=0.00 13:02:14

. di "=================================================================="
==================================================================
r; t=0.00 13:02:14

. di "  All paper tables saved to $ttab/"
  All paper tables saved to ../outputs/tables/
r; t=0.00 13:02:14

. di "=================================================================="
==================================================================
r; t=0.00 13:02:14

. 
. log close
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/11b_PaperTables_log.txt
  log type:  text
 closed on:  25 Jun 2026, 13:02:14
--------------------------------------------------------------------------------------------------------------------
